home *** CD-ROM | disk | FTP | other *** search
- Path: sdrc.com!thor!scjones
- From: larry.jones@sdrc.com (Larry Jones)
- Newsgroups: comp.lang.c
- Subject: Re: sprintf() question
- Date: 27 Mar 1996 21:44:17 GMT
- Organization: SDRC Engineering Services
- Distribution: world
- Message-ID: <4jccrh$3gb@info1.sdrc.com>
- References: <31593522.76B3@cbm.com>
- NNTP-Posting-Host: thor.sdrc.com
- Originator: scjones@thor
-
- In article <31593522.76B3@cbm.com>, Dave Payne <paynedc@cbm.com> writes:
- > Is it safe, and more importantly, is it ANSI standard, to use sprintf()
- > to print into the same variable? Consider this example:
-
- NO! NO! A thousand times, NO! (Can you tell I just spent a lot of time
- tracking down a problem in NCSA Mosaic which turned out to be exactly
- this?) Except for functions that explicitly handle overlapping source
- and destination like memmove, if the source and destination overlap the
- behavior is undefined.
- ----
- Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH 45150-2789 513-576-2070
- larry.jones@sdrc.com
- I wonder if you can refuse to inherit the world. -- Calvin
-